﻿using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Text;

namespace Reader.Core.Application.Models
{
    public class NewBookModel
    {
        public string Name { get; set; }
        public string Cover { get; set; }
        public string Author { get; set; }
        public bool? Completed { get; set; }
        public string Intro { get; set; }
        public int? ShelfId { get; set; }
        public string Path { get; set; }
        public NewBookSiteModel Site { get; set; }
        public List<NewBookVolumeModel> Volumes { get; set; }
        public List<NewBookChapterModel> Chapters { get; set; }
    }
    public class NewBookSiteModel
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Url { get; set; }
    }
    public class NewBookVolumeModel
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
    public class NewBookChapterModel
    {
        public int? Id { get; set; }
        public int VolumeId { get; set; }
        public string Name { get; set; }
        public string Url { get; set; }
        public string Content { get; set; }
    }
    public class CreateChapterModel
    {
        public int? Id { get; set; }
        public int BookId { get; set; }
        public string Name { get; set; }
        public string Url { get; set; }
        public string Content { get; set; }
        public bool Force { get; set; }
        public LastChapterModel Last { get; set; }
        public int Current { get; set; }
        public int Total { get; set; }
        public int Prev
        {
            get
            {
                if(Current == 1)
                {
                    return 1;
                }
                else
                {
                    return Current - 1;
                }
            }
        }
        public int Next
        {
            get
            {
                if(Current == Total)
                {
                    return Total;
                }
                else
                {
                    return Current + 1;
                }
            }
        }
    }
    public class LastChapterModel
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Url { get; set; }
    }
}
